//
//  UIToolbar+Extension.swift
//  MyWeibo
//
//  Created by 余丽丽 on 15/10/28.
//  Copyright © 2015年 余丽丽. All rights reserved.
//

import UIKit

extension UIToolbar {

    ///  让toolBar中item平均分布
     func FlexibleTool(){
        
        let count = self.items?.count
        for i in 0..<count!-1 {
            
            let FlexibleBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil)
            
            self.items?.insert(FlexibleBtn, atIndex: 2 * i + 1)
        }
        
    }
    

}